package com.dev;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
class CrossZebraDrawable extends ColorDrawable {
	int zebra;
	public CrossZebraDrawable(int zebra){
		this.zebra=zebra;
	}
	@Override 
	public void draw(Canvas canvas){
		int cw=canvas.getWidth();
		int ch=canvas.getHeight();
		if(zebra<=0)zebra=3;
		int start=zebra/2;
		Paint p=new Paint();
		for(int x=-start;x<cw;x+=zebra){
			for(int y=-start;y<ch;y+=zebra*2){
				canvas.drawRect(x,y,x+zebra,y+zebra,p);
			}
			x+=zebra;
			for(int y=-start+zebra;y<ch;y+=zebra*2){
				canvas.drawRect(x,y,x+zebra,y+zebra,p);
			}
		}
	}
}
